<%@ page import="sun.net.ftp.FtpClient"%>
<%@ page pageEncoding="UTF-8"%>
<%@ page import="java.util.List"%>
<%@ page import="ch01.FirstlevelTitle"%>
<%@ page import="ch03.FirstLevelTitleDbOpreation"%>
<%@ include file="checklogin.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>title_file.jsp</title>
<style type="text/css">
h2 {
	margin-top: 50px;
}

#content {
	position: absolute;
	top: 150px;
	left: 100px;
}

#footer {
	margin-top: 300px;
	margin-left: 100px;
	font-size: larger;
	font-weight: bold;
}
</style>

<script type="text/javascript">
	function checkTitleFile() {
		//var titleName = document.getElementById("txt_TwoTitle");
		//var filePath = documnent.getElementById("filePath");
		if (form1.twotile.value == "" || form1.twotile.value == null) {
			alert("请输入二级标题!");
			return false;
		}
		if (form1.filepath.value == "" || form1.filepath.value == null) {
			alert("请指定对应文件路径!");
			return false;
		}
		return true;
	}
</script>

</head>

<body>
	<form action="saveSecondLevelTitle.jsp" name="form1" method="post">
		<h2 align="center">&nbsp;二级标题及文件位置发布</h2>
		<div id="content">
			<table>
				<tr>
					<%
						List list = FirstLevelTitleDbOpreation.getAllFirstLevelTitleList();
					%>
					<td>一级标题：<select name="parent">
							<%
								if (list.size() > 0) {
									for (int i = 0; i < list.size(); i++) {
										FirstlevelTitle fTitle = (FirstlevelTitle) list.get(i);
										%>
										<option value="<%=fTitle.getId()%>"><%=fTitle.getTitleName()%></option>
										<%
									}
								}
							%>
					</select></td>
				</tr>
				<tr>
					<td>二级标题：<input type="text" size="50" name="twotile"
						id="txt_TwoTitle" /></td>
				</tr>
				<tr>
					<td>文件位置：<input type="file" id="filePath" name="filepath"
						size="50" /></td>
				</tr>
				<tr>
					<td align="center"><input type="submit" id="btn_Submit"
						value="确定" onClick="return checkTitleFile()" /> &nbsp;&nbsp; <input
						type="reset" id="btn_Reset" value="重置" /></td>
				</tr>
				<tr>
					<td align="right" style="color:red;"><br /> (二级标题最好与新闻稿件标题一致)</td>
				</tr>
			</table>
		</div>
		<div id="footer">注意：发布前请检查输入的内容是否正确。</div>
	</form>
</body>
</html>
